/**
 * 登陆输出数据
 */
interface LoginOutListItemResponse extends BaseResponse{
    /**
     * 用户编号
     */
    userId:number;
    /**
     * 用户名
     */
    userName:string;
    /**
     * 真实姓名状态
     */
    realNameState: number;
    /**
     * 头像
     */
    headImage:string;
    /**
     * point
     */
    point:number;
    /**
     * Token
     */
    token:string;
}

/**
 * 登陆服务
 */
interface ILoginService{
    login(email: string, password: string): ng.IHttpPromise<LoginOutListItemResponse>;
}

class loginService implements ILoginService{
    constructor(private http: ng.IHttpService, private route: routeService){
    }

    login(email: string, password: string): ng.IHttpPromise<LoginOutListItemResponse>{
        return this.http<LoginOutListItemResponse>({
            method:"POST",
            url:this.route.getUrl("login"),
            data:{
                email: email,
                password: password
            }
        })
    }
}
app.service("loginService",['$http','routeService',loginService]);